﻿<phone:PhoneApplicationPage 
    x:Class="YiDingCanWp7.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:YiDingCanWp7"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="728" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <local:LatestShopsSettings x:Key="latestShopsSettings"></local:LatestShopsSettings>
        <local:FavoriteShops x:Key="favorateshops"></local:FavoriteShops>
		<Style x:Key="NavStyle" TargetType="Image">
			<Setter Property="Margin" Value="0,0,0,0"/>
			<Setter Property="Height" Value="167"/>
			<Setter Property="Width" Value="167"/>
		</Style>
		<Style x:Key="ApplicationTitle" TargetType="TextBlock">
			<Setter Property="Height" Value="240"/>
			<Setter Property="FontSize" Value="72"/>
			<Setter Property="Padding" Value="0,74,33,0"/>
			<Setter Property="Foreground" Value="#e67b08"/>
		</Style>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Panorama 控件-->
        <controls:Panorama Name="panarama" SelectionChanged="panarama_SelectionChanged">
            <controls:Panorama.Title>
                    <StackPanel Height="168">
                        <TextBlock Text="易订餐"   Style="{StaticResource ApplicationTitle}" />
                         <toolkit:PerformanceProgressBar x:Name="performanceProgressBar"  Foreground="Red" Background="Red" IsIndeterminate="True"/>
                    </StackPanel>
            </controls:Panorama.Title>
            <controls:Panorama.Background>
                <ImageBrush ImageSource="PanoramaBackground.png"/>
            </controls:Panorama.Background>
             <!--Panorama 项目一-->
            <controls:PanoramaItem Header="导航" Foreground="#e67b08" FontSize="40" Name="NavPanoramaItem" Orientation="Horizontal" Width="380" Height="610">
                <Grid Name="MainGrid" Height="520" ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0,-30,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.333*"></RowDefinition>
                        <RowDefinition Height="0.333*"/>
                        <RowDefinition Height="0.333*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*"></ColumnDefinition>
                        <ColumnDefinition Width="0.5*"/>
                    </Grid.ColumnDefinitions>
                    <Image Grid.Row="0" Grid.Column="0" Style="{StaticResource NavStyle}"  Source="/YiDingCanWp7;component/images/sites/local.png" MouseLeftButtonUp="Image_MouseLeftButtonUp"   />
                    <Image Grid.Column="1" Grid.Row="1" Style="{StaticResource NavStyle}"  Name="ShareImage" Source="/YiDingCanWp7;component/images/sites/share.png" MouseLeftButtonUp="Image_MouseLeftButtonUp_Share"    />
                    <Image Grid.Row="1" Style="{StaticResource NavStyle}"  Source="/YiDingCanWp7;component/images/sites/setting.png" MouseLeftButtonUp="Image_MouseLeftButtonUp_Setting" ImageFailed="Image_ImageFailed"  Grid.Column="0"   />
                    <Image Grid.Column="1" Grid.Row="0" Style="{StaticResource NavStyle}"  Source="/YiDingCanWp7;component/images/sites/search.png" MouseLeftButtonUp="Image_MouseLeftButtonUp_Search"  />
                    <Image Grid.Row="2" Name="LoginImage" Style="{StaticResource NavStyle}"  Source="/YiDingCanWp7;component/images/sites/login.png" MouseLeftButtonUp="Image_MouseLeftButtonUp_Login" Grid.Column="0"  />
                    <Image Grid.Row="2" Grid.Column="1" Style="{StaticResource NavStyle}"  Source="/YiDingCanWp7;component/images/sites/feedback.png"  MouseLeftButtonUp="Image_MouseLeftButtonUp_Feedback" />
                    <Image Grid.Row="2" Name="imageUserCenter" Style="{StaticResource NavStyle}"  Source="/YiDingCanWp7;component/images/sites/usercenter.png" MouseLeftButtonUp="Image_MouseLeftButtonUp_Login" Grid.Column="0"  />
                </Grid>
            </controls:PanoramaItem>
            <!--Panorama 项目二-->
            <!--使用“Orientation="Horizontal"”可使面板水平放置-->
            <controls:PanoramaItem Header="最近使用"  Foreground="#e67b08" FontSize="40" Width="380" Height="600">
                <!--具有图像占位符和文字环绕的双线列表-->
                <ListBox Margin="0,0,-12,0" Name="LatestShop">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="0,0,0,17">
                                <StackPanel Width="311">
                                    <TextBlock Text="{Binding Title}" FontSize="26" TextWrapping="Wrap" Foreground="Gray" Style="{StaticResource PhoneTextExtraLargeStyle}">
                         <toolkit:ContextMenuService.ContextMenu>
                        <toolkit:ContextMenu>
                            <!-- You can c tilt on indivudal menu items with TiltEffect.SuppressTilt="True" -->
                            <toolkit:MenuItem  Tag="{Binding}"  Header="拨电话" Click="MenuItemPhone_Click"/>
                            <toolkit:MenuItem  Tag="{Binding}"  Header="查看" Click="MenuItemGoToShop_Click"/>
                            <toolkit:MenuItem Header="删除"  Tag="{Binding}"  Click="MenuItem_Click"/>
                        </toolkit:ContextMenu>
                    </toolkit:ContextMenuService.ContextMenu>
                                    </TextBlock>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>
            <controls:PanoramaItem Header="收藏" Width="380" FontSize="40"  Foreground="#e67b08" Height="600">
                <!--具有图像占位符和文字环绕的双线列表-->
                <ListBox Margin="0,0,-12,0" Name="FavShopList">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="0,0,0,17">
                                <StackPanel Width="311">
                                    <TextBlock Text="{Binding Title}" FontSize="26"  Foreground="Gray" TextWrapping="Wrap"  Style="{StaticResource PhoneTextExtraLargeStyle}">
                                        <toolkit:ContextMenuService.ContextMenu>
                        <toolkit:ContextMenu>
                            <!-- You can suppress tilt on indivudal menu items with TiltEffect.SuppressTilt="True" -->
                            <toolkit:MenuItem  Tag="{Binding}"  Header="拨电话" Click="MenuItemPhone_Click"/>
                            <toolkit:MenuItem  Tag="{Binding}"  Header="查看" Click="MenuItemGoToShop_Click"/>
                            <toolkit:MenuItem Header="删除"  Tag="{Binding}"  Click="MenuItem_Click_1"/>
                        </toolkit:ContextMenu>
                    </toolkit:ContextMenuService.ContextMenu>
                                    </TextBlock>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>
        </controls:Panorama>
        
    </Grid>
    
    <phone:PhoneApplicationPage.ApplicationBar>
        
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Minimized">

            <!--<shell:ApplicationBarIconButton x:Name="Refresh" IconUri="/images/refresh.png" Text="刷新" Click="Refresh_Click"/>-->
            <shell:ApplicationBarIconButton IconUri="/images/appbar.add.rest.png" Text="添加" Click="ApplicationBarIconButton_Click" />
            <shell:ApplicationBarIconButton x:Name="Search" IconUri="/images/appbar.feature.search.rest.png" Text="搜索" Click="Search_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarIconButton x:Name="Setting" IconUri="/images/settings.png" Click="Setting_Click" Text="设置"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>